package com.example.student1.service.impl;

import com.example.student1.dao.Student_LoginRepository;
import com.example.student1.domain.Student;
import com.example.student1.domain.Student_Login;
import com.example.student1.service.Student_LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;
import java.util.List;

@Service
@Transactional
public class Student_LoginImpService implements Student_LoginService {
    @Autowired
    Student_LoginRepository student_loginRepository;

/*查询所有学生*/

    public List<Student_Login> findAll() {

        return student_loginRepository.findAll();
    }

    public List<Student_Login> findByNameAndPassword(String name, String password){
        return student_loginRepository.findByNameAndPassword(name,password);
    }

    public Student_Login insert(Student_Login student_login) {
        return student_loginRepository.save(student_login);
    }
}
